<?php

namespace App\Http\Requests\Admin\Panx\Material;

use App\Http\Requests\ApiRequest;

/**
 * @property string num
 * @property string sold_at
 * @property string operator
 * @property string customer_id
 * @property string remark
 */
class MaterialUpdateRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'customer_id' => 'required|int|min:1|max:'.self::MAX_INT,
            'num'         => 'required|int|min:1|max:'.self::MAX_INT,
            'sold_at'     => 'required|date',
            'operator'    => 'required|string|max:'.self::MAX_STRING,
            'remark'      => 'nullable|string|max:'.self::MAX_STRING
        ];
    }
}
